import request from '@/utils/request'

const activityApi = {
  // 活动列表
  getActivityList: (params) => {
    return request({
      url: '/chain/promotion/activity/page',
      method: 'GET',
      params
    })
  },
  // 获取活动详情
  getActivityDetail: (activityId) => {
    return request({
      url: `/promotion/activity/get?id=${activityId}`,
      method: 'GET'
    })
  },
  // 新增活动
  addActivity: (data) => {
		return request({
			url: '/chain/promotion/activity/create',
			method: 'POST',
      data
		})
	},
  // 更新活动
  updateActivity: (data) => {
		return request({
			url: '/chain/promotion/activity/update',
			method: 'PUT',
      data
		})
	},
  // 删除活动
  deleteActivity: (activityId) => {
		return request({
			url: `/promotion/activity/delete?id=${activityId}`,
			method: 'DELETE'
		})
	},
  // 更新活动状态
  updateActivityStatus: (data) => {
		return request({
			url: '/promotion/activity/update/status',
			method: 'PUT',
      data
		})
	},
  // 获取活动统计数据
  getStatisticData: () => {
    return request({
      url: '/chain/promotion/activity/overview',
      method: 'GET'
    })
  },
  // 获取活动订单统计数据
  getStatisticOrder: () => {
    return request({
      url: '/trade/order/getActivityCount',
      method: 'GET'
    })
  },
  // 可选供应商列表
  getSupplierList: (params) => {
		return request({
			url: '/vms/supplier/page',
			method: 'GET',
      params
		})
	}
}

export default activityApi
